﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Umbraco.Forms.Data.Storage;
using Umbraco.Forms.Data;

namespace ContourStrikesAgain.Razor
{
    public class Library
    {
        public static DynamicRecordList GetApprovedRecordsFromPage(int pageId)
        {
            return new DynamicRecordList(XmlHelper.XmlToRecords(((System.Xml.IHasXmlNode)Umbraco.Forms.Library.GetApprovedRecordsFromPage(pageId).Current).GetNode()));
        }

        public static DynamicRecordList GetApprovedRecordsFromFormOnPage(int pageId, string formId)
        {
            return new DynamicRecordList(XmlHelper.XmlToRecords(((System.Xml.IHasXmlNode)Umbraco.Forms.Library.GetApprovedRecordsFromFormOnPage(pageId, formId).Current).GetNode()));
        }

        public static DynamicRecordList GetRecordsFromPage(int pageId)
        {
            return new DynamicRecordList(XmlHelper.XmlToRecords(((System.Xml.IHasXmlNode)Umbraco.Forms.Library.GetRecordsFromPage(pageId).Current).GetNode()));
        }

        public static DynamicRecordList GetRecordsFromFormOnPage(int pageId, string formId)
        {
            return new DynamicRecordList(XmlHelper.XmlToRecords(((System.Xml.IHasXmlNode)Umbraco.Forms.Library.GetRecordsFromFormOnPage(pageId, formId).Current).GetNode()));
        }

        public static DynamicRecordList GetRecordsFromForm(string formId)
        {
            return new DynamicRecordList(XmlHelper.XmlToRecords(((System.Xml.IHasXmlNode)Umbraco.Forms.Library.GetRecordsFromForm(formId).Current).GetNode()));
        }

    }
}